//
//  BaseTableViewCell.swift
//  SwiftProject
//
//  Created by 董駸 on 2022/8/16.
//

import UIKit

class BaseTableViewCell: UITableViewCell {
    /// 修改Cell中contentView四周间距 只支持固定高度的情况下 预估高度不适用
    var contentViewInset : UIEdgeInsets {
        .zero
    }
    
    override var frame: CGRect {
        didSet {
            var newFrame = frame
            newFrame.origin.x += contentViewInset.left
            newFrame.size.width -= contentViewInset.left + contentViewInset.right
            newFrame.origin.y += contentViewInset.top
            newFrame.size.height -= contentViewInset.top + contentViewInset.bottom
            super.frame = newFrame
        }
    }
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
